28171df8b90763a095a3d85701c8e68fdc9f7524,http/http2-engine/src/main/java/com/webpieces/http2engine/impl/shared/Level4ClientStateMachine.java,Level4ClientStateMachine,fireToClient,#Stream#PartialStream#Runnable#,105
Before Change
Http2PayloadType payloadType = translate(payload);
Http2Event event = new Http2Event(Http2SendRecieve.RECEIVE, payloadType);
stateMachine.fireEvent(currentState, event);
if(payload.isEndOfStream())
stateMachine.fireEvent(currentState, new Http2Event(Http2SendRecieve.RECEIVE, Http2PayloadType.END_STREAM_FLAG)); //validates state transition is ok
After Change
Http2PayloadType payloadType = translate(payload);
Http2Event event = new Http2Event(Http2SendRecieve.RECEIVE, payloadType);
CompletableFuture<State> result = stateMachine.fireEvent(currentState, event);
result.thenCompose( s -> {
if(payload.isEndOfStream())
return stateMachine.fireEvent(currentState, new Http2Event(Http2SendRecieve.RECEIVE, Http2PayloadType.END_STREAM_FLAG)); //validates state transition is ok